package myapp.framelibrary.http;

import android.content.Context;
import android.text.TextUtils;

import java.util.List;
import java.util.Map;

import myapp.baselibrary.http.EngineCallBack;
import myapp.baselibrary.http.HttpUtils;
import myapp.baselibrary.http.IHttpEngine;
import myapp.framelibrary.db.DaoSupport;
import myapp.framelibrary.db.DaoSupportFactory;
import myapp.framelibrary.db.IDaoSupport;

/**
 * Created by yang2 on 2017/6/23.
 * //okHttp默认引擎
 */

public class OKHttpEngine implements IHttpEngine {

    private   String resultJson = null;
    //这里做缓存
    @Override
    public void get(boolean cache,Context context, String url, Map<String, Object> params, EngineCallBack callBack) {
        String s = HttpUtils.jointParams(url, params);
        String cacheJson = CacheDataUtil.getCacheJson();
        if (!TextUtils.isEmpty(cacheJson)){
            callBack.onSuccess(resultJson);
        }

    }

    @Override
    public void post(boolean cache,Context context, String url, Map<String, Object> params, EngineCallBack callBack) {

    }
}
